<html>
<head>
    <title>透析助手</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.5.6/css/sm.min.css">
    <link rel="stylesheet" href="__PUBLIC__/css/style.css">
    <link rel="stylesheet" href="__PUBLIC__/css/5s.css">
    <link rel="stylesheet" href="__PUBLIC__/css/6m.css">
    <link rel="stylesheet" href="__PUBLIC__/css/iconfont.css">
    <style type="text/css">
        #massTxt{width:100%;height:3rem;font-size:0.8rem;text-align:left;border:none;font-weight:100;}
    </style>
</head>
<body>
	<div class="head head-another">
		<div class="HeadContent">
			<a href="<{:U('Index/doctor')}>" class="backIndex"><i class="iconfont">&#xe605;</i></a>
			<div class="search">
            <form method="get" action="<{:U('index')}>" id="serchForm" style="margin:0;">
                <input type="hidden" name="m" value="<{:MODULE_NAME}>" />
                <input type="hidden" name="c" value="<{:CONTROLLER_NAME}>" />
                <input type="hidden" name="a" value="<{:ACTION_NAME}>" />
				<input type="text" placeholder="请输入关键字" name="keywords" value="<{:I('get.keywords')}>" />
				<a href="javascript:;" onclick="javascript:$('#serchForm').submit();">搜索</a>
			</div>
			<a href="javascript:;" class="HeadTitle">患者列表</a>
		</div>
	</div>
	<div class="RecordInformation-public PersonalList addtop">
		<ul>
        <empty name="list">
            <li style="padding-top:15px;">暂 无 消 息</li>
        <else />
            <foreach name="list" item="vo">
			<li>
				<a href="<{:U('Chat/Index/user',array('sender'=>$userInfo['phone'],'receiver'=>$vo['phone'],'name'=>$vo['name']))}>">
				<div class="LeftImg">
                    <if condition="$vo['pic'] eq ''">
                        <img src="__PUBLIC__/images/PersonalHeadImg.png">
                    <else />
                        <img src="<{$vo.pic}>">
                    </if>
				</div>
				<div class="MiddleContent">
					<div class="MiddleHead">
						<{$vo.name|default='患者'}><b><{$vo.msg_num|default='0'}></b>
					</div>
					<div class="MiddleFoot">
						<{$vo.msg_content}>
					</div>
				</div>
                </a>
			</li>
            </foreach>
        </empty>
		</ul>
	</div>
	<div class="BtnGroup">
		<button class="AddRecord btn-submit" type="button" onclick="$('.Popwindow').show()">群发</button>
	</div>
    <!-- 增加弹窗开始 -->
    <div class="Popwindow">
        <div class="PopContent">
            <div class="PopContentTitle">消息群发</div>
            <div class="PopContentText">
                <div class="PopContentText-input">
                    <textarea placeholder="请输入群发内容" maxlength="300" id="massTxt"></textarea>
                    <div style="clear:both;"></div>
                </div>
                <div class="BtnGroup Btn-Popwindow">
                    <button class="btn-drop" type="button" onclick="javascript:$('.Popwindow').hide();">取消</button>
                    <button class="btn-submit" type="button" onclick="save()">确定</button>     
                </div>
            </div>
        </div>
    </div>
    <!-- 增加弹窗结束 -->
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.5.7/js/sm.min.js' charset='utf-8'></script>
<script type='text/javascript' src='__PUBLIC__/js/myjq.js'></script>
<script type="text/javascript">
    //群发
    function save(){
        var content = $('#massTxt').val();
        if(content == ''){
            $.toast('请输入消息内容');return;
        }
        loadingShow();
        $.post('<{:U("mass")}>',{phone:'<{$userInfo.phone}>',content:content},function(res){
            $('.Popwindow').hide();
            loadingHide();
            if(res == 'suc'){
                $.toast('发送成功');
            }else{
                $.toast('发送失败');
            }
        });
    }
</script>
</body>
</html>